$().ready(function(){
    var __delete = function(e){
        var tmp = $(e.currentTarget);
        var tmpid = tmp.attr("href");
        $.post("/action/master/deleteAlbum", {
            Action: "post",
            id: tmpid
        }, function(data, textStatus){
            if (!data.success) {
                //$("#errormsg").text("删除图集出现问题，请将错误信息发送给管理员处理："+data.message);
                //$(".notification").removeClass("success").addClass("error").fadeTo("slow", 1).fadeIn(400).delay(4000).slideUp(400);
                $(".loadingbox").empty();
                $(".loadingbox").append(loadingTpl, {
                    icoType: 'fail',
                    loadIcon: '',
                    msgHtml: data.message
                });
                $(".loadingbox").delay(3000).fadeOut(600);
            }
            else {
                //$("#errormsg").text("图集删除成功！");
                // $(".notification").removeClass("error").addClass("success").fadeTo("slow", 1).fadeIn(400).delay(4000).slideUp(400);
                $(".loadingbox").empty();
                $(".loadingbox").append(loadingTpl, {
                    icoType: "succ",
                    loadIcon: "",
                    msgHtml: data.message
                });
                $(".loadingbox").fadeIn(50);
                $(".loadingbox").delay(2000).fadeOut(600);
                tmp.parents(".albump").hide("slide", {
                    direction: "up"
                }, 1000).delay(1000).remove;
            }
        }, "json");
    };
    
    $(".delBtn").click(__delete).easyconfirm({
        locale: {
            title: '操作确认',
            text: '您确定要删除该图集么？',
            button: ['取消', '是的，确定删除']
        }
    });
    
    
    $(".albump").mousemove(function(e){
        $(e.currentTarget).css("background", "#e9eae9");
    }).mouseout(function(e){
        $(e.currentTarget).css("background", "#fff");
    })
    
});
